# syntax=docker/dockerfile:1

##
## Build
##
FROM golang:1.17-alpine as builder

# 启用go module
ENV GO111MODULE=on \
    GOPROXY=https://goproxy.cn,direct

WORKDIR /app

COPY . .
RUN go mod download

RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o /practise8


FROM scratch
WORKDIR /

COPY --from=builder /practise8 /practise8

EXPOSE 5000


